<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/views/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/views/include/nocachehead.jsp"%>
<title>${attraction.name}</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.raty.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/ratyStar.js"></script>
</head>

<body>
	<%@ include file="/views/include/statusbar.jsp"%>
	<br>
	<br>
	<br>
	<div>
		<c:if test="${not empty siteType}">
			<span>位置：</span>
			<c:if test="${siteType eq 'COUNTRY'}">
				<a>${attractionList[0].country}</a>
			</c:if>
			<c:if test="${siteType eq 'PROVINCE'}">
				<a href="${pageContext.request.contextPath}/attraction/list.html?siteType=COUNTRY&siteId=${siteId}">${attractionList[0].country}</a>
				<em>&gt;</em>
				<a>${attractionList[0].province}</a>
			</c:if>
			<c:if test="${siteType eq 'CITY'}">
				<a href="${pageContext.request.contextPath}/attraction/list.html?siteType=COUNTRY&siteId=${siteId}">${attractionList[0].country}</a>
				<em>&gt;</em>
				<a href="${pageContext.request.contextPath}/attraction/list.html?siteType=PROVINCE&siteId=${siteId}">${attractionList[0].province}</a>
				<em>&gt;</em>			
				<a>${attractionList[0].city}</a>
			</c:if>
			
			<a href="${pageContext.request.contextPath}/attraction/list.html">全部</a>
		</c:if>
		<c:if test="${empty siteType}">
			<a>全部</a>
		</c:if>
		<skyline:setSessionAttrToVar var="SESSION_USER" key="SESSION_USER"/>
		<c:if test="${not empty pageScope.SESSION_USER }">
			<a href="${pageContext.request.contextPath}/attraction/discovery.html">我要添加</a>
		</c:if>
	</div>
	<div>
		<c:forEach items="${attractionList}" var="attraction">
			<div>
				<div>
					<a href="${pageContext.request.contextPath}/attraction/view/${attraction.id}.html">
						<img title="${attraction.name}" src="${pageContext.request.contextPath}/image/${attraction.portrait}" />
					</a>
				</div>
				<div>
					<p>
						<a href="${pageContext.request.contextPath}/attraction/view/${attraction.id}.html">${attraction.name }</a>
					</p>
					<div>
						<div id="Raty_${attraction.id}" title="${attraction.star }">网友评分：</div>
					</div>
					<p>地点：${attraction.country }${attraction.province }${attraction.city }</p>
					<p>详细地址：${attraction.detailAddress }</p>
					<p>简介：<skyline:summary length="60" value="${attraction.introduction }"/></p>
				</div>
			</div>
			<br>
		</c:forEach>
		<div>
			<skyline:page url="${pageContext.request.contextPath}/attraction/list.html?siteId=${siteId }&siteType=${siteType }" page="${requestScope.page}" maxSize="6" />
		</div>
	</div>
	
	<script type="text/javascript">
		(function($){
			$(document).ready(function(){
				
				$("div[id^=Raty_]").each(function(){
					var This = this;
					var targetId = this.id.substring(5);
					var setting = {
						width:'200px',
						targetId:targetId,
						targetObj:This,
						targetType:'ATTRACTION',
						readOnly:true,
						start:$(This).attr('title')
					};
					Raty.init(setting);
				});
			});
		})(jQuery);
	</script>
</body>
</html>